<template>
  <div class="detail-base-info">
    <p class="title">{{goodsInfo.title}}</p>
    <div>
      <span class="price">{{goodsInfo.lowNowPrice | formatPrice(goodsInfo.highNowPrice)}}</span>
      <div>
        <span class="discount" v-show="goodsInfo.discount">{{goodsInfo.discount}}</span>
        <br>
        <span class="old-price">{{goodsInfo.oldPrice}}</span>
      </div>
    </div>
    <div class="buy-info">
      <div v-for="item in goodsInfo.columns">{{item}}</div>
    </div>
    <div class="services">
      <div v-for="item in goodsInfo.services">
        <img :src="item.icon">
        <span>{{item.name}}</span>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailBaseInfo",
    props: {
      goodsInfo: {
        type: Object,
        default() {
          return {}
        }
      }
    }
  }
</script>

<style scoped>
  .detail-base-info {
    padding: 10px;
    border-bottom: 5px solid #f2f5f8;
  }

  .title {
    font-size: 17px;
    color: black;
    margin-bottom: 10px;
  }

  .price {
    line-height: 35px;
    font-size: 25px;
    color: var(--color-high-text);
    float: left;
    position: relative;
  }

  .old-price {
    margin-left: 5px;
    font-size: 12px;
    text-decoration:line-through;
  }

  .discount {
    padding: 2px;
    margin-left: 5px;
    font-size: 12px;
    color: var(--color-background);
    background-color: var(--color-high-text);
    border-radius:4px;
  }

  .buy-info {
    margin-top: 10px;
    font-size: 14px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eeeeee;

    display: flex;
    justify-content: space-between;
  }

  .services {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
  }

  .services img {
    width: 13px;
  }

  .services span {
    font-size: 14px;
  }

</style>
